//Ta Duc Viet
//Kiem tra so nguyen to
#include <iostream>
#include <cmath>
using namespace std;
bool Nguyen_To ( int a);
int main(){
	int a;
	do{
		cout << "Nhap so can kiem tra (< 1000):";
		cin >> a;
	} while ( a <= 0 || a > 1000);
	if ( Nguyen_To ( a)) cout << a << " la so nguyen to";
	else cout << a << " khong la so nguyen to";
	cout << endl;
	system("pause");
	return 0;
}
bool Nguyen_To ( int a){
	if ( a == 1) return true;
	else{
		for ( int i = 2; i < sqrt(float(a)) ; i ++){
			if ( a % i == 0 ) return false;
		}
		return true;
	}
}
